package pattern.observer;

import java.util.Observable;

public class Product extends Observable {
    private double price;

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
        // 设置观察点
        this.setChanged();
        // 通知所有观察者
        this.notifyObservers(price);
    }
}
